package com.cff.presenter;

import java.util.List;

import com.cff.bean.ViewLog;
import com.cff.model.ILogDetailModel;
import com.cff.model.LogDetailModelFromFile;
import com.cff.view.ILogView;

public class ViewLogPresenter {
	private ILogView iLogView; 
	private ILogDetailModel iLogDetailModel;
	
	public ViewLogPresenter(ILogView iLogView){
		this.iLogView = iLogView;
		this.iLogDetailModel = new LogDetailModelFromFile();
	}
	
	
	public void loadViewLog(){
		List<ViewLog> viewLogs = iLogDetailModel.getViewLog();	
		iLogView.setViewLog(viewLogs);
	}
	
	public void saveViewLog(){
		ViewLog viewLog = iLogView.getViewLog();
		iLogDetailModel.saveViewLog(viewLog);
	}

}
